<?= isset($header) ? $header : '' ?>

<script type="text/Javascript" src="/js/market.js"></script>


<input type="hidden" id="fucking_object_id"  value="<?= $object->market_research_id ?>">
<div id="content">

    <form method="post" action="<?= site_url('/MarketResearch/market/data_edit_submit') ?>">

        <div style="overflow:visible;" class="form_style">

            <div class="title">

                <h5>市調資料
                    <?php if (empty($display)) { ?>
                        修改&nbsp;
                        <input 	type="button" value="單筆配對" class="input_background" name="pair_submit" id="pair_submit">&nbsp;
                        <input  type="button" value="復制市調" class="input_background" name="copy_client_but" id="copy_client_but" onclick="show_copy_object()" style="display:none;">
                    <?php } ?>
                </h5>

            </div>

            <div id="userinfo">
                <table>
                    <tbody>
                        <tr><td class="table_title" colspan="8">客戶</td></tr>
                        <tr>
                            <th style="width:90px;">市調編號</th>
                            <td width="144">
                                <input type="text" name="market_survey_no" id="market_survey_no" style="width:120px;" value="<?= $object->market_survey_no ?>">
                            </td>
                            <th width="75"></th>
                            
                            
                            
                            
                            <td width="200" >
                                <input type="checkbox"  value="1"  name="type_sale" id="type_sale"  <?
                                       if ($object -> type_sale == "1")
                                       echo "checked";
                                       ?> onclick="select_sale()">買賣
                                       <input type="checkbox" value="1" name="type_rent" id="type_rent" <?
                                       if ($object -> type_rent == "1")
                                       echo "checked";
                                       ?> onclick="select_rent()">租賃
                                       <!--
                                       <input type="checkbox" value="1" name="type_help_seal" id="type_help_seal" <? if($object->type_help_seal=="1") echo "checked";?> >代銷
                                       -->
                            </td>
                            
                            
                            <th width="72"  >市調狀態</th>
                            <td >
                                <input type="text" name="market_research_status" id="obj_mark" style="width: 200px;" value="<?= !empty($object->market_research_status) ? $object->market_research_status : '' ?>" >


                            </td>
                        </tr>



                    <input type="hidden" id="client_verify_code" name="ref_client_verify_code" value="<?= $object->ref_client_verify_code ?>" >
                    <input type="hidden" name="client_contact_id"  value="<?= $object->client_contact_id ?>" >
                    <input type="hidden" name="client_id"  value="<?= $object->client_id ?>" >

                    <?php
                    if (!$show_contact) {
                        ?>


    <tr style="display:none;"><td style="background-color: paleturquoise;" class="table_title" colspan="8">客戶</td></tr>

    <tr>
        <th style="background-color: paleturquoise;">所有權人</th>
        <td width="144">

            <input type="text" id="owner" name="client[name]" style="width:120px;" value="<?= ($client->num_rows() > 0) ? $client->row()->name : ''; ?>"  >
        </td>

        <th width="74" style="background-color: paleturquoise;">手機</th>
        <td width="150">
            <input type="text" id="owner_mobile" style="width:120px;" name="client[mobile]" value="<?= ($client->num_rows() > 0) ? $client->row()->mobile : '' ?>" >
        </td>

        <th width="67" style="background-color: paleturquoise;">電話</th>
        <td width="107">

            <input type="text" id="owner_phone" style="width:100px;" 
            name="client[home_phone]" 
            value="<?= ($client->num_rows() > 0) ? $client->row()->home_phone : '' ?>" >

        </td>

        <th width="37" style="background-color: paleturquoise;"  >E-mail</th>
        <td width="107" >

            <div style="width:250px;">

                <input type="text" name="client[email]"
        		  value="<?=!empty($client->row()->email)?$client->row()->email:""?>"
                >                                       
                
            </div>
        </td>
        
    </tr>

    <tr>
        <th style="background-color: paleturquoise;">委 託 人</th>
        <td>
            <input type="text" id="edit_contact_name" name="contact[name]" style="width:120px;" value="<?= !empty($contact[0]) ? $contact[0]->name : '' ?>">
        </td>
        <th style="background-color: paleturquoise;">手機</th>
        <td>
            <input type="text" id="contact_mobile" style="width:120px;" name="contact[mobile]" value="<?= !empty($contact[0]) ? $contact[0]->mobile : '' ?>">
        </td>
        <th style="background-color: paleturquoise;">電話</th>
        <td>
            <input type="text" id="contact_phone_info" style="width:100px;" 
            name="contact[home_phone]" 
            value="<?= !empty($contact[0]) ? $contact[0]->home_phone : '' ?>">
        </td>
        
        <th width="37" style="background-color: paleturquoise;"  >E-mail</th>
        <td width="107" >

            <div style="width:250px;">

                <input type="text" name="contact[email]"
                		value="<?= !empty($contact[0]) ? $contact[0]->email : '' ?>"  
                >                                        
                
            </div>
        </td>
    </tr>


                    <?php } ?>





                    <tr><td class="table_title" colspan="8">區域</td></tr>
                    <tr>
                        <th class="must_write">案名</th>
                        <td>
                            <input id="case_name" name="case_name" size="50" style="width:148px;" value="<?= $object->case_name ?>" />
                        </td>
                        <th>大樓名稱</th>
                        <td>
                            <input id="building_name" name="building_name" size="50" style="width:148px;" value="<?= $object->building_name ?>" />
                            <input type="button" value="新增社區資料" onclick="" class="input_background">
                        </td>
                        <th>物件用途</th>
                        <td>
                        	
                        	<input type="text" class="full_select" name="object_usage" id="object_usage" value="<?=$object -> object_usage?>"><br />
                        		
                        </td>
                        <th>物件類型</th>
                        <td>
                            	<input type="text" class="full_select" name="object_styles" id="object_styles" value="<?=$object -> object_styles?>">
                            		
                            		
                            	
                        </td>
                    </tr>

                    <tr>
                        <th>建物門牌 </th>
                        <td colspan="3">行政區&nbsp;<input type="text"  id="administrative_area" name="administrative_area" onclick="show_administrative_area('administrative_area');" style="width:120px;" value="<?= $object->administrative_area ?>">&nbsp;
                        	<input type="text" style="width:350px;" id="house_building" name="house_building" value="<?= $object->house_building ?>" onclick="show_hous_ebuilding('house_building');">
                        </td>
                        <th>重點區域</th>
                        <td>
                            <input type="text" style="width:100px;" id="area" name="area" value="<?= $object->area ?>" onclick="show_emphasis_area('area')"><br><input type="button" value="回謄本" class="input_background">
                        </td>
                        <th>建號</th>
                        <td><input type="text" style="width:200px;" name="build_number" id="build_number" value="<?= $object->build_number ?>"></td>
                    </tr>
                    </tbody>
                </table>
                <table id="sale_case" style="<?php
                if ($object->type_sale != 1)
                //echo "display: none;";
                ?>">
                    <!-- 售案 start -->

                    <tbody>
                        <tr><td class="table_title" colspan="8">售價</td></tr>
                        <tr>
                            <th width="150">總價</th>
                            <td width="250"><input type="text" style="width:74px;" name="sale_total" id="sale_total" value="<?= intval($object->sale_total) ?>">萬,
                                含車位 <input type="text" style="width:40px;" name="sale_parking" id="sale_parking" value="<?= intval($object->sale_parking) ?>">個
                            </td>
                            <th width="64">
                                房屋售價                    </th>
                            <td width="146">
                                <input type="text" style="width:70px;" name="sale_housing_prices" id="sale_housing_prices" value="<?= intval($object->sale_housing_prices) ?>">萬
                            </td>
                            <th width="65">
                                房屋單價                    </th>
                            <td width="106">
                                <input type="text" style="width:66px;" name="sale_housing_unit_price" id="sale_housing_unit_price" value="<?= intval($object->sale_housing_unit_price) ?>">萬/坪
                            </td>

                            <th>土地單價</th>
                            <td colspan=""><input type="text" style="width:100px;" name="sale_land_unit_price" id="sale_land_unit_price" value="<?= intval($object->sale_land_unit_price) ?>">萬/坪</td>
                        </tr>
                        <tr>
                            <th>車位單價</th>
                            <td><input type="text" style="width:100px;" name="sale_parking_unit_price" id="sale_parking_unit_price" value="<?= intval($object->sale_parking_unit_price) ?>">萬/個</td>

                            <th width="62">車位總價</th>
                            <td colspan="5"><input type="text" style="width:70px;" name="sale_parking_price" id="sale_parking_price" value="<?= intval($object->sale_parking_price) ?>">萬</td>


                        </tr>
                        <!-- 售案 end -->
                    </tbody></table>
                <table id="rent_case"  style="<?php
                if ($object->type_rent != 1)
                    //echo "display: none;";
                ?>">
                    <!-- 租案 start -->
                    <tbody>
                        <tr><td class="table_title" colspan="8">租案</td></tr>
                        <tr>
                            <th width="150">總價</th>
                            <td width="250"><input type="text" name="rent_total" id="rent_total" value="<?= intval($object->rent_total) ?>" style="width:30px;" >&nbsp;萬/月,<input type="checkbox" name="rent_tax" id="rent_tax" value="1" <?
                                                                                                                                                                                    if ($object -> rent_tax == 1)
                                                                                                                                                                                    echo "checked";
                                                                                                                                                                                    ?>>含稅/車位&nbsp;<input type="text" style="width:30px;" name="rent_parking" id="rent_parking" value="<?= intval($object->rent_parking) ?>">&nbsp;個
                            </td>
                            <th width="64">房屋租金</th>
                            <td width="146">
                                <input type="text" name="rent_housing_rent" id="rent_housing_rent" value="<?= intval($object->rent_housing_rent) ?>" style="width:100px;" >萬/月
                            </td>
                            <th width="65">車位租金</th>
                            <td width="106"><input type="text" name="rent_parking_space_rentals" id="rent_parking_space_rentals" value="<?= intval($object->rent_parking_space_rentals) ?>" style="width:66px;">萬/月</td>
                            <th width="62">每坪租金</th>
                            <td colspan="">
                                <input type="text" name="rent_rent_per_ping" id="rent_rent_per_ping" value="<?= intval($object->rent_rent_per_ping) ?>" style="width:70px;">萬
                            </td>
                        </tr>
                        <tr>
                            <th>每月車位租金</th>
                            <td>
                                <input type="text" name="rent_monthly_rent_parking_spaces" id="rent_monthly_rent_parking_spaces" value="<?= intval($object->rent_monthly_rent_parking_spaces) ?>" style="width:30px;">萬/個,押 金：<input type="text" name="rent_deposit_month" id="rent_deposit_month" style="width:30px;" value="<?= intval($object->rent_deposit_month) ?>">月<input type="text" name="rent_deposit_money" id="rent_deposit_money" style="width:30px;" value="<?= intval($object->rent_deposit_money) ?>">萬
                            </td>
                            <th>租期最少</th>
                            <td><input type="text" name="rent_min" id="rent_min" value="<?= intval($object->rent_min) ?>" style="width:30px;">年,最長<input type="text" name="rent_max" id="rent_max" value="<?= intval($object->rent_max) ?>" style="width:30px;">年</td>
                            <th>租期調漲 </th>
                            <td colspan="3"><input type="text" style="width: 66px;" name="rent_lease_hike" id="rent_lease_hike" value="<?= intval($object->rent_lease_hike) ?>">萬</td>
                        </tr>

                        <tr>
                            <th>免租裝潢期</th>
                            <td><input type="text" name="rent_rent_free_period_decoration" id="rent_rent_free_period_decoration" value="<?= $object->rent_rent_free_period_decoration ?>"></td>
                            <th>公證</th>
                            <td colspan="5">
                                <input type="checkbox" value="1" name="rent_notarization" id="rent_notarization" <?
                                       if ($object -> rent_notarization == 1)
                                       echo "checked";
                                       ?>>有
                            </td>
                        </tr>

                        <!-- 租案 end -->
                    </tbody></table>
                <table>
                    <tbody>
                        <tr><td class="table_title" colspan="8">面積</td></tr>
                        <tr>
                            <th width="150">建物面積</th>
                            <td width="150">
                                <input type="text" name="building_area" id="building_area" value="<?= $object->building_area ?>" style="width: 100px;">坪
                            </td>
                            
                            <th width="74"  onclick="main_build_area()" >
                                <a onclick="main_build_area()" style="cursor: pointer;">
                                    主建物面積
                                </a>
                            </th>
                            <td  onclick="main_build_area()" >

                                <input type="text" name="main_building_area" id="main_building_area" value="<?= $object->main_building_area ?>" style="width: 100px;">坪

                            </td>
                            <th width="74"  onclick="subsidiary()" >
                                <a onclick="subsidiary()" style="cursor: pointer;">
                                    附屬建物面積
                                </a>
                            </th>
                            <td width="74" onclick="subsidiary()" ><input type="text" name="subsidiary_building_area" id="subsidiary_building_area" value="<?= $object->subsidiary_building_area ?>" style="width: 100px;">坪</td>
                            <th width="20"  onclick="pubilc_set()" >
                                <a onclick="pubilc_set()" style="cursor: pointer;">
                                    公設
                                </a>
                            </th>
                            <td  onclick="pubilc_set()" >
                            	<input type="text" name="postulate" id="postulate" value="<?= $object->postulate ?>" size="15" style="width: 80px;">坪</td>
                        </tr>
                        <tr>
                            <th>總權狀面積</th>
                            <td>
                                <input type="text" name="total_weight_shaped_area" id="total_weight_shaped_area" value="<?= $object->total_weight_shaped_area ?>" style="width: 70px;">坪,含車位<br/><input type="text" name="with_parking_number" id="with_parking_number" value="<?= $object->with_parking_number ?>" style="width: 70px;">個
                            </td>
                            <th>車位面積</th>
                            <td><input type="text"  name="parking_area" id="parking_area" value="<?= intval($object->parking_area) ?>" style="width:100px;">坪/<br/><input type="text"  name="parking_area_number" id="parking_area_number" value="<?= intval($object->parking_area_number) ?>" style="width:100px">個</td>
                            <th  onclick="show_use_area();" >
                                <a onclick="show_use_area();" style="cursor: pointer;">
                                    使用面積
                                </a>
                            </th>
                            <td  onclick="show_use_area();" ><input type="text" name="use_area" id="use_area" value="<?= $object->use_area ?>" style="width: 100px;">坪</td>
                            <th>公設比</th>
                            <td><input type="text" name="postulate_than" id="postulate_than" value="<?= intval($object->postulate_than) ?>" style="width: 80px;">%</td>
                        </tr>
                        <tr>
                            <th>基地坐落</th>
                            <td>
                                <input type="text" style="width:100px;" id="base_is_located1" name="base_is_located1" value="<?= $object->base_is_located1 ?>">段<br/><input type="text" style="width:100px;" name="base_is_located2" id="base_is_located2" value="<?= $object->base_is_located2 ?>">小段
                            </td>
                            <th>地號</th>
                            <td><input type="text" name="to_no" id="to_no" value="<?= $object->to_no ?>" style="width: 100px;"></td>
                            <th>土地面積(基地)</th>
                            <td><input type="text" name="base_area" id="base_area" value="<?= intval($object->base_area) ?>" style="width: 100px;">坪</td>
                            <th>權利範圍</th>
                            <td><input type="text" name="scope_of_rights1" id="scope_of_rights1" value="<?= $object->scope_of_rights1 ?>" style="width: 80px;">分之<br/><input type="text"  name="scope_of_rights2" id="scope_of_rights2" value="<?= $object->scope_of_rights2 ?>" style="width: 80px;"></td>
                        </tr>
                        <tr>
                            <th>土地持份面積</th>
                            <td>
                                <input type="text" name="stakeholders_land_area" id="stakeholders_land_area" value="<?= intval($object->stakeholders_land_area) ?>" style="width: 100px;">坪
                            </td>

                            <th>公告現值</th>

                            <td>
                                <input type="text" name="present_value" id="present_value" value="<?= intval($object->present_value) ?>" style="width: 100px;">元
                            </td>
                            <th>總公告現值</th>
                            <td colspan="3"><input type="text" name="total_present_value1" id="total_present_value1" value="<?= intval($object->total_present_value1) ?>" style="width: 100px;">萬<input type="text" name="total_present_value2" id="total_present_value2" value="<?= $object->total_present_value2 ?>" style="width: 50px;">年
                            </td>
                        </tr>
                        <tr>
                            <th>土地使用分區</th>
                            <td>
                                <select class="full_select" name="land_use_zoning" id="land_use_zoning">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($land_use_zoning as $key=>$val){
                                    ?>
                                    <option value="<?= $val->land_use_zoning_id ?>" <?
                                            if ($object -> land_use_zoning == $val -> land_use_zoning_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>容積率</th>
                            <td><input type="text" name="volume_rate" id="volume_rate" value="<?= intval($object->volume_rate) ?>" style="width: 100px;">%</td>
                            <th>建蔽率</th>
                            <td colspan="3"><input type="text" name="building_coverage_ratio" id="building_coverage_ratio" value="<?= intval($object->building_coverage_ratio) ?>" style="width: 100px;">%</td>

                        </tr>
                        <tr>
                            <th>每月管理費</th>
                            <td>
                                <input type="text" name="monthly_management_fee" id="monthly_management_fee" value="<?= intval($object->monthly_management_fee) ?>" style="width: 100px;">元/月
                            </td>
                            <th>每坪管理費</th>
                            <td><input type="text" name="management_fees_per_ping" id="management_fees_per_ping" value="<?= intval($object->management_fees_per_ping) ?>" style="width: 90px;">元/月</td>
                            <th>管理方式</th>
                            <td>
                                <select class="full_select" style="width: 120px;" name="management" id="management">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($management as $key=>$val){
                                    ?>
                                    <option value="<?= $val->management_id ?>" <?
                                            if ($object -> management == $val -> management_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>附屬配備 </th>
                            <td>
                                <input id="rent_ancillary" name="rent_ancillary" size="50" style="width:100px;" value="<?= $object->rent_ancillary ?>" />
                            </td>
                        </tr>
                        <tr><td class="table_title" colspan="8">概要</td></tr>
                        <tr>
                            <th  onclick="inside_crid()" >
                                <a onclick="inside_crid()" style="cursor: pointer;">
                                    室內格局:
                                </a>
                            </th>
                            <td  onclick="inside_crid()" >
                                <input type="text" style="width:40px;" name="indoor_pattern_house" id="indoor_pattern_house" value="<?= $object->indoor_pattern_house ?>">房
                                <input type="text" style="width:40px;" name="indoor_pattern_hall" id="indoor_pattern_hall" value="<?= $object->indoor_pattern_hall ?>">廳<br>
                                <input type="text" style="width:40px;" name="indoor_pattern_guard" id="indoor_pattern_guard" value="<?= $object->indoor_pattern_guard ?>">衛
                                <input type="text" style="width:40px;" name="indoor_pattern_suite" id="indoor_pattern_suite" value="<?= $object->indoor_pattern_suite ?>">套房
                            </td>
                            <th>落地窗</th>
                            <td>
                                <select class="full_select" name="windows" id="windows">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($windows as $key=>$val){
                                    ?>
                                    <option value="<?= $val->value ?>" <?
                                            if ($object -> windows == $val -> value)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>該戶大門</th>
                            <td>
                                <select class="full_select" name="household_door" id="household_door">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($base_is_located as $key=>$val){
                                    ?>
                                    <option value="<?= $val->value ?>" <?
                                            if ($object -> household_door == $val -> value)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>本棟大門</th>
                            <td>
                                <select class="full_select" name="building_entrance" id="building_entrance">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($base_is_located as $key=>$val){
                                    ?>
                                    <option value="<?= $val->value ?>" <?
                                            if ($object -> building_entrance == $val -> value)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>當層戶數</th>
                            <td>
                                <input type="text" name="households" id="households" value="<?= $object->households ?>" style="width: 110px;">戶
                            </td>
                            <th>該棟戶數</th>
                            <td><input type="text" name="building_households" id="building_households" value="<?= $object->building_households ?>" style="width: 110px;">戶</td>
                            <th>總棟數</th>
                            <td><input type="text" name="total_towers" id="total_towers" value="<?= $object->total_towers ?>" style="width: 90px;">棟</td>
                            <th>總戶數</th>
                            <td><input type="text" name="total_households" id="total_households" value="<?= $object->total_households ?>" style="width: 90px;">戶</td>
                        </tr>
                        <tr>
                            <th>所在樓層</th>
                            <td>
                                <input type="text" name="floor" id="floor" value="<?= $object->floor ?>" style="width: 110px;">層
                            </td>
                            <th>樓層規劃</th>
                            <td>地上<input type="text" name="floor_plan1" id="floor_plan1" value="<?= $object->floor_plan1 ?>" style="width: 80px;">層 <br> 地下<input type="text" name="floor_plan2" id="floor_plan2" value="<?= $object->floor_plan2 ?>" style="width: 80px;">層</td>
                            <th>電梯數</th>
                            <td>客梯<input type="text" name="number_of_lifts1" id="number_of_lifts1" value="<?= $object->number_of_lifts1 ?>" style="width: 60px;">個<br>
                                貨梯<input type="text" name="number_of_lifts2" value="<?= $object->number_of_lifts2 ?>" id="number_of_lifts2" style="width: 60px;">個
                            </td>
                            <th>面臨路寬</th>
                            <td><input type="text" name="facing_the_lane" id="facing_the_lane" value="<?= intval($object->facing_the_lane) ?>" style="width: 90px;">米</td>
                        </tr>
                        <tr>
                            <th>使用現況</th>
                            <td>
                                <select class="full_select" name="use_status" id="use_status">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($use_status as $key=>$val){
                                    ?>
                                    <option value="<?= $val->use_status_id ?>" <?
                                            if ($object -> use_status == $val -> use_status_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>租賃到期日</th>
                            <td><input type="text" onclick="WdatePicker()" style="width:100px;" class="Wdate" id="lease_maturity" name="lease_maturity" value="<?= $object->lease_maturity ?>" style="width: 50px;"></td>
                            <th>承租方行業別</th>
                            <td><input type="text" name="lessee_by_industry" id="lessee_by_industry" value="<?= $object->lessee_by_industry ?>" style="width: 100px;"></td>
                            <th>樓地板高度</th>
                            <td><input type="text" name="floor_height" id="floor_height" value="<?= intval($object->floor_height) ?>" style="width: 90px;">米</td>
                        </tr>
                        <tr>

                            <th>建物外觀</th>

                            <td>



                                <select class="full_select" name="building_exterior" id="building_exterior">
                                    <option value="">&nbsp;</option>
                                    <?php
                                    foreach($building_exterior as $key=>$val){
                                    ?>
                                    <option value="<?= $val->building_exterior_id ?>"
                                            <?php
                                                if($object->building_exterior==$val->building_exterior_id){ echo "SELECTED"; }
                                            ?>> <?= $val->value ?></option>
                                    <?php
                                    }
                                    ?>
                                </select>
                            </td>

                            <th>主要建材</th>
                            <td>
                                <select class="full_select" style="width: auto;" name="main_building" id="main_building">
                                    <option value=""></option>
                                    <?
                                    foreach($main_building as $key=>$val){
                                    ?>
                                    <option value="<?= $val->main_building_id ?>" <?
                                            if ($object -> main_building == $val -> main_building_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>建物完成日</th>
                            <td><input type="text" onclick="WdatePicker({onpicked: statistics_year_of_construction})" style="width:100px;" class="Wdate" id="building_completion_date" name="building_completion_date" value="<?= $object->building_completion_date ?>"></td>
                            <th>屋齡</th>
                            <td><input type="text" name="year_of_construction"  id="year_of_construction" value="<?= $object->year_of_construction ?>" style="width: 90px;" readonly="readonly">年</td>
                        </tr>
                        <tr>
                            <th>年租金</th>
                            <td>
                                <input type="text" name="annual_rent" id="annual_rent"  value="<?= intval($object->annual_rent) ?>" style="width: 100px;">萬/年
                            </td>
                            <th>投報率</th>
                            <td><input type="text" name="reported_rate" id="reported_rate" value="<?= intval($object->reported_rate) ?>" style="width: 100px;">%</td>
                            <th>建設公司</th>
                            <td><input type="text" style="width:110px;" name="construction_company" id="construction_company" value="<?= $object->construction_company ?>"></td>
                            <th>建築執照號</th>
                            <td><input type="text" style="width:110px;" name="construction_license_no" id="construction_license_no" value="<?= $object->construction_license_no ?>"></td>
                        </tr>
                        <tr>
                            <th>帶看方式</th>
                            <td>
                                <select class="full_select" name="look_mode" id="look_mode">
                                    <option value=""></option>
                                    <?
                                    foreach($look_mode as $key=>$val){
                                    ?>
                                    <option value="<?= $val->look_mode_id ?>" <?
                                            if ($object -> look_mode == $val -> look_mode_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>鑰匙管理</th>
                            <td>
                                有
                                <input type="radio" name="key_management" id="key_management" value="1" <?php if ($object->key_management == 1) {
                           echo 'checked';
                       } ?> >
                                無
                                <input type="radio" name="key_management" id="key_management" value="0" <?php if ($object->key_management == 0) {
                           echo 'checked';
                       } ?> >
                            </td>
                            <th>地圖定位<br><input type="button" value="點此定位" onclick="show_locate_map();" class="input_background"></th>
                            <td>
                                <input type="text" id="location_map1" name="location_map1" value="<?= $object->location_map1 ?>" style="width:110px;"><br/>
                                <input type="text" id="location_map2" name="location_map2" value="<?= $object->location_map2 ?>" style="width:110px;">
                            </td>
                            <th>幣別/面積單位</th>
                            <td>
                                <select class="full_select" name="currency" id="currency">
                                    <?
                                    foreach($currency as $key=>$val){
                                    ?>
                                    <option value="<?= $val->currency_id ?>" <?
                                            if ($object -> currency == $val -> currency_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                                <select class="full_select" name="area_unit" id="area_unit">
                                    <?
                                    foreach($area_unit as $key=>$val){
                                    ?>
                                    <option value="<?= $val->area_unit_id ?>" <?
                                            if ($object -> area_unit == $val -> area_unit_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>銀行設定總金額</th>
                            <td>
                                <input type="text" name="bank_set_total_amount" id="bank_set_total_amount" value="<?= intval($object->bank_set_total_amount) ?>" style="width: 110px;">萬
                            </td>
                            <th>貸款銀行</th>
                            <td><input type="text" style="width:110px;" name="loan_bank" id="loan_bank" value="<?= $object->loan_bank ?>" style="110px;"></td>
                            <th class="zt">其他設定金額</th>
                            <td colspan="3"><input type="text" style="width: 110px;" name="other_settings_amount" id="other_settings_amount" value="<?= intval($object->other_settings_amount) ?>">萬</td>
                        </tr>

                        <tr>
                            <th>自備款</th>
                            <td>
                                <input type="text" name="bring_own_money"  id="bring_own_money" value="<?= intval($object->bring_own_money) ?>" style="width: 110px;">萬
                            </td>
                            <th>預估貸款</th>
                            <td colspan="5"><input type="text" style="width:110px;" name="estimated_loan" id="estimated_loan" value="<?= intval($object->estimated_loan) ?>">萬</td>
                        </tr>

                        <tr><td class="table_title" colspan="8">環境</td></tr>
                        <tr>
                            <th>環境特色</th>
                            <td colspan="3">
                                <input type="text"style="width:300px" name="environmental_features" id="environmental_features" value="<?= $object->environmental_features ?>">
                            </td>
                            <th>物件特色</th>
                            <td  colspan="3">
                                <input type="text"style="width:300px" name="object_features" id="object_features" value="<?= $object->object_features ?>">
                            </td>
                        </tr>
                        <tr>
                            <th colspan="">公共設施</th>
                            <td colspan="3">
                                <input type="text"style="width:300px" name="public_facilities" id="public_facilities" value="<?= $object->public_facilities ?>">
                            </td>
                            <th>消防保全</th>
                            <td colspan="3">
                                <input type="text"style="width:300px" name="fire_and_security" id="fire_and_security" value="<?= $object->fire_and_security ?>">
                            </td>
                        </tr>

                        <tr>
                            <th>商圈1</th>
                            <td>
                                <input type="text" style="width:129px;"  id="circle1" name="circle1" value="<?= $object->circle1 ?>" onclick="show_circle('circle1');">
                            </td>
                            <th>商圈2</th>
                            <td>
                                <input type="text" style="width:130px;"  id="circle2" name="circle2" value="<?= $object->circle2 ?>" onclick="show_circle('circle2');">
                            </td>
                            <th>公園1</th>
                            <td>
                                <input type="text" style="width:96px;"  id="park1" name="park1" value="<?= $object->park1 ?>" onclick="show_park('park1')">
                            </td>
                            <th>公園2</th>
                            <td>
                                <input type="text" style="width:100px;" id="park2" name="park2" value="<?= $object->park1 ?>" onclick="show_park('park2')">
                            </td>
                        </tr>

                        <tr>
                            <th>捷運線1</th>
                            <td>
                                <select onchange="get_line(1);" class="full_select" style="width:136px;" name="mrt_line1" id="mrt_line1">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($mrt_line as $key=>$val){
                                    ?>
                                    <option value="<?= $val->mrt_line_id ?>"  <?
                                            if ($object -> mrt_line1 == $val -> mrt_line_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>捷運站1</th>
                            <td>
                                <select id="mrt1" class="full_select"  style="width:136px;" name="mrt1">
                                    <option value="">&nbsp;</option>
                                    <?
                                    if($object->mrt_line1>0){
                                    foreach($mrt[$object->mrt_line1] as $key=>$val){
                                    ?>
                                    <option value="<?= $key ?>" <?
                                            if ($object -> mrt1 == $key)
                                            echo "selected";
                                            ?>><?= $val ?></option>
                                    <?
                                    }
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>捷運線2</th>
                            <td>
                                <select onchange="get_line(2);" class="full_select" style="width:106px;" name="mrt_line2" id="mrt_line2">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($mrt_line as $key=>$val){
                                    ?>
                                    <option value="<?= $val->mrt_line_id ?>"  <?
                                            if ($object -> mrt_line2 == $val -> mrt_line_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                            </td>
                            <th>捷運站2</th>
                            <td>
                                <select id="mrt2" class="full_select" style="width:106px;" name="mrt2">
                                    <option value="">&nbsp;</option>
                                    <?
                                    if($object->mrt_line2>0){
                                    foreach($mrt[$object->mrt_line2] as $key=>$val){
                                    ?>
                                    <option value="<?= $key ?>" <?
                                            if ($object -> mrt2 == $key)
                                            echo "selected";
                                            ?>><?= $val ?></option>
                                    <?
                                    }
                                    }
                                    ?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>學區(國小) </th>
                            <td>
                                <input type="text" style="width:129px;" id="school_district_primary" name="school_district_primary" value="<?= $object->school_district_primary ?>" onclick="show_elementary_school('school_district_primary')">
                            </td>
                            <th>學區(國中)</th>
                            <td>
                                <input type="text" style="width:130px;" id="school_district_high" name="school_district_high" value="<?= $object->school_district_high ?>" onclick="show_junior_school('school_district_high')">
                            </td>
                            <th>學區(高中)</th>
                            <td colspan="3">
                                <input type="text" id="school_district_senior" name="school_district_senior" value="<?= $object->school_district_senior ?>" onclick="show_senior_middle_school('school_district_senior')">
                            </td>
                        </tr>
                        <tr><td class="table_title" colspan="8">車位</td></tr>
                        <tr>
                            <th>車位所在樓層</th>
                            <td>
                                <input type="text"  style="width:120px;" name="spaces_where_floor" id="spaces_where_floor" value="<?= $object->spaces_where_floor ?>">
                            </td>
                            <th>車位號碼</th>
                            <td>
                                <input type="text" style="width:120px;" name="parking_numbers" id="parking_numbers" value="<?= $object->parking_numbers ?>">
                            </td>
                            <th>車位入口高度</th>
                            <td colspan="6"><input type="text" name="parking_entrance_height" id="parking_entrance_height" value="<?= intval($object->parking_entrance_height) ?>" style="width:120px;">米</td>
                        </tr>
                        <tr>
                            
                            <th>獨立權狀車位</th>
                            <td>
                                <input type="text" name="separate_parking1" id="separate_parking1" value="<?= $object->separate_parking1 ?>" style="width:50px;">坪
                                <input type="text" name="separate_parking2" id="separate_parking2" value="<?= $object->separate_parking2 ?>" style="width:40px;">個
                            </td>
                            <th>車位管理費</th>
                            <td>
                                <input type="text" style="width:50px;" name="car_park_management_fee" id="car_park_management_fee" value="<?= intval($object->car_park_management_fee) ?>">元/月/個
                            </td>
                            <th>車位總管理費</th>
                            <td>
                                <input type="text" style="width:70px;" name="total_management_fee_parking" id="total_management_fee_parking" value="<?= intval($object->total_management_fee_parking) ?>">元/月
                            </td>
                        </tr>
                        <tr>
                            <th>車位類型1</th>
                            <td>
                                <select class="full_select" style="width:auto;"  name="parking_type1" id="parking_type1">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($parking_type as $key=>$val){
                                    ?>
                                    <option value="<?= $val->parking_type_id ?>" <?
                                            if ($object -> parking_type1 == $val -> parking_type_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                                型<br/>
                                <input type="text" style="width:80px;" name="parking_number1" id="parking_number1" value="<?= $object->parking_number1 ?>">個
                            </td>
                            <th>車位單買1</th>
                            <td>
                                <input type="text" name="parking_price1" id="parking_price1" value="<?= intval($object->parking_price1) ?>" style="width: 80px;">萬
                            </td>
                            <th>車位類型2</th>
                            <td>
                                <select class="full_select" style="width:auto;"  name="parking_type2" id="parking_type2">
                                    <option value="">&nbsp;</option>
                                    <?
                                    foreach($parking_type as $key=>$val){
                                    ?>
                                    <option value="<?= $val->parking_type_id ?>" <?
                                            if ($object -> parking_type2 == $val -> parking_type_id)
                                            echo "selected";
                                            ?>><?= $val->value ?></option>
                                    <?
                                    }
                                    ?>
                                </select>
                                型<br/>
                                <input type="text" style="width:80px;"  name="parking_number2" id="parking_number2" value="<?= $object->parking_number2 ?>">個
                            </td>
                            <th>車位單買2</th>
                            <td>
                                <input type="text"  name="parking_price2" id="parking_price2" value="<?= intval($object->parking_price2) ?>" style="width: 80px;" >萬
                            </td>
                        </tr>
                        <tr>
                            <th style="width: 90px;">使用權車位數</th>
                            <td><input type="text" style="width: 80px;" name="use_parking_number" id="use_parking_number" value="<?= $object->use_parking_number ?>">個</td>
                            <th>抽籤</th>
                            <td><input type="text" style="width: 70px;" name="ballot" id="ballot" value="<?= $object->ballot ?>">年抽一次</td>
                            <th>公設車位</th>
                            <td>
                                <input type="text" name="public_parking_spaces1" id="public_parking_spaces1" value="<?= intval($object->public_parking_spaces1) ?>" style="width:50px;">坪
                                <input type="text" name="public_parking_spaces2" id="public_parking_spaces2" value="<?= $object->public_parking_spaces2 ?>" style="width:50px;">個
                            </td>
                            <th>上網</th>
                            <td colspan="4">
                                <input type="radio" value="0" name="internet" id="internet" <?
                                       if ($object -> internet == 0)
                                       echo "checked";
                                       ?> >否
                                       <input type="radio" value="1" name="internet" id="internet" <?
                                       if ($object -> internet == 1)
                                       echo "checked";
                                       ?> >是
                            </td>
                        </tr>
                        <tr>
                            <th>鑑價日期</th>
                            <td>
                                <input type="text" class="Wdate" onclick="WdatePicker()" id="valuation_date" readonly="readonly" name="valuation_date" value="<?= $object->valuation_date ?>" style="width:100px;">
                            </td>
                            <th>鑑價機構</th>
                            <td>
                                <input type="text"style="width:120px;" name="appraisal_agencies" id="appraisal_agencies" value="<?= $object->appraisal_agencies ?>">
                            </td>
                            <th>鑑價金額</th>
                            <td><input type="text" style="width:76px;" name="valuation_amount" id="valuation_amount" value="<?= intval($object->valuation_amount) ?>">萬</td>
                            <th>物件案別</th>
                            <td>
                            	
                                <input type="checkbox" value="1" <?
                                       if (strstr($object -> object_case_type, "1"))
                                       echo "checked";
                                       ?> name="object_case_type[]">中古屋<br/>
                                <input type="checkbox" value="2"  <?
                                       if (strstr($object -> object_case_type, "2"))
                                       echo "checked";
                                       ?> name="object_case_type[]">預售<br/>
                                <input type="checkbox"  value="3" <?
                                       if (strstr($object -> object_case_type, "3"))
                                       echo "checked";
                                       ?> name="object_case_type[]">標售
                            </td>
                        </tr>
                        <tr>
                            <th>附近成交行情 </th>
                            <td><input type="text" style="width:100px;" name="transaction_prices_near" id="transaction_prices_near" value="<?= intval($object->transaction_prices_near) ?>"></td>
                            <th>密件</th>
                            <td>
                                <input type="radio" <?
                                       if ($object -> bcc == "N")
                                       echo "checked";
                                       ?> value="N" name="bcc" >否
                                       
                                       <input type="radio" <?
                                       if ($object -> bcc == "Y")
                                       echo "checked";
                                       ?> value="Y" name="bcc">是
                            </td>
                            <th>狀態</th>
                            <td>
                                <select name="status" id="status" class="full_select">
                                    <option value="1" <?
                                            if ($object -> status == 1)
                                            echo "selected";
                                            ?>>有效</option>
                                    <option value="0" <?
                                            if ($object -> status == 0)
                                            echo "selected";
                                            ?>>無效</option>
                                </select>
                            </td>
                            <th>無效說明</th>
                            <td><input type="text" style="width:100px;" name="invalid_description" id="invalid_description" value="<?= $object->invalid_description ?>"></td>
                        </tr>
                        <tr>
                            <th>備註 </th>
                            <td colspan="7"><textarea  name="remark" id="remark" style="width: 800px; height: 95px;"><?= $object->remark ?></textarea></td>
                        </tr>
                        
                        
                        <tr>
                            <th>機密等級</th>
                            <td>
                                <select name="sercet_level" id="sercet_level"  >	
									<option value="1" <?= ($object->sercet_level==1)?"SELECTED":"" ?> >普通</option>						
									<option value="3" <?= ($object->sercet_level==3)?"SELECTED":"" ?> >極機密</option>
									<option value="2" <?= ($object->sercet_level==2)?"SELECTED":"" ?> >機密</option>														
								</select>
                            </td>

                            <th>是否公開</th>
                            <td>
                                
                                <select name="is_public" id="is_public"  >														
									<option value="1" <?= ($object->is_public==1)?"SELECTED":"" ?> >公開</option>
									<option value="2" <?= ($object->is_public==2)?"SELECTED":"" ?> >不公開</option>							
								</select>	    		
                            </td>

                            <th>重要性</th>
                            <td>
                            	<select name="important" id="important" >
									<option value="1"   <?= ($object->important==1)?"SELECTED":"" ?>  >普通</option>								
									<option value="3"   <?= ($object->important==3)?"SELECTED":"" ?> >極重要</option>
									<option value="2"   <?= ($object->important==2)?"SELECTED":"" ?> >重要</option>												
								</select>
                            </td>

                            <th style="display:none;">遮蔽欄位</th>
                            <td style="display:none;">
                               <select name="is_see" id="is_see" >														
									<option value="2" <?= ($object->is_see==2)?"SELECTED":"" ?>>遮蔽</option>
									<option value="1" <?= ($object->is_see==1)?"SELECTED":"" ?>>不遮蔽</option>							
								</select>
                            </td>
                        </tr>



                        <?php
                        $user_array = array();
                        foreach ($users as $user) {
                            $user_array[$user->users_id] = $user->name;
                        }
                        ?>
                        <tr>
                            <th>接待人</th>
                            <td>
                                <input type="hidden" value="<?= $object->front_man ?>" size="12" name="front_man" id="front_man" >

                                <?php
                                foreach ($user_array as $key => $value) {
                                    if ($key == $object->front_man) {
                                        echo $value;
                                    }
                                }
                                ?>
                            </td>
                            <th>主管</th>
                            <td>
                                <?php
                                foreach ($user_array as $key => $value) {
                                    if ($key == $object->head) {
                                        echo $value;
                                    }
                                }
                                ?>
                                <input type="hidden" name="head" id="head" value="<?= $object->head ?>" style="width:130px;">
                            </td>
                            <th>原經紀人</th>
                            <td><input type="hidden" id="original_broker" name="original_broker"></td>
                            <th>經紀人</th>
                            <td>
                                <?php
                                foreach ($user_array as $key => $value) {
                                    if ($key == $object->broker) {
                                        echo $value;
                                    }
                                }
                                ?>
                                <input type="hidden" name="broker" id="broker" value="<?= $object->broker; ?>">


                            </td>



                        </tr>

                                <?php if (empty($display)) { ?>
                            <tr>
                                <td colspan="5"></td>
                                <td>
                                    <?php
                                    
                                    if ($send_to_admin) {
                                        if(!$show_contact){
                                        ?>
                                        <input type="submit" onclick="return update_checkform();" value="主管審核" class="input_background" id="update_checkform">
                                        <?php
                                        }
                                    }
                                    ?>
                                </td>
                                <td class="last_save">
    <?php
    if (!$show_contact) {
        ?>

                                        <input type="hidden" id="object_id" name="object_id" value="<?= $object->market_research_id ?>">
                                        <input type="button" value="存檔" class="input_background" id="object_edit_update_submit">

        <?php
    }
    ?>
                                </td>
                                <td  class="last_save">

                                </td>
                            </tr>
<?php } ?>
                    </tbody>
                </table>



            </div>
            <!-- 物件資料結束 -->
        </div>


        <div id="copy_object_div" style="display: none;width:300px;">
            <div id="part_city_div"  style="float:left;padding:10px">
                <h3>姓名</h3>
                <input type="text" value="" id="c_name" >
            </div>
            <div id="part_country_div"  style="float:left;padding:10px;width:102px;">
                <h3>手機</h3>
                <input type="text" value="" id="c_mobile" >

            </div>
            <div id="part_div"  style="float:left;padding:10px;width:102px;">
                <h3>家裡電話</h3>
                <input type="text" value="" id="c_phone" >

            </div>

            <div style="clear: both;"></div>

            <div id="p_div" style="padding:10px">

            </div>

        </div>




        <script>
            $("documnet").ready(function() {

                $("#sun_area").change(function() {
                    $("#subsidiary_sun_area").val($(this).val());
                });
                $("#flower_sun").change(function() {
                    $("#subsidiary_flower_sun").val($(this).val());
                });
                $("#falt_sun").change(function() {
                    $("#subsidiary_falt_sun").val($(this).val());
                });
                $("#terrace_flat").change(function() {
                    $("#subsidiary_terrace_flat").val($(this).val());
                });
                $("#no_sun").change(function() {
                    $("#subsidiary_no_sun").val($(this).val());
                });
                $("#subsid_other").change(function() {
                    $("#subsidiary_subsid_other").val($(this).val());
                });

                //$("#subsid_other").change(function(){
                //    $("#subsidiary_subsid_other").val( $(this).val() );
                //});

                //主建物面
                $("#main_area").change(function() {
                    $("#main_build_area_main_area").val($(this).val());
                });
                //其樓
                $("#isfloor").change(function() {
                    $("#main_build_area_isfloor").val($(this).val());
                });
                //梯間
                $("#staircases").change(function() {
                    $("#main_build_area_staircases").val($(this).val());
                });
                //其他
                $("#m_b_other").change(function() {
                    $("#main_build_area_m_b_other").val($(this).val());
                });

                $("#courtyard_area").change(function() {
                    $("#t_use_area_courtyard_area").val($(this).val());
                });
                $("#basement").change(function() {
                    $("#t_use_area_basement").val($(this).val());
                });
                $("#terrace").change(function() {
                    $("#t_use_area_terrace").val($(this).val());
                });
                $("#additional").change(function() {
                    $("#t_use_area_additional").val($(this).val());
                });

                $("#p_main").change(function() {
                    $("#pubilc_set_p_main").val($(this).val());
                });
                $("#p_big").change(function() {
                    $("#pubilc_set_p_big").val($(this).val());
                });
                $("#p_small").change(function() {
                    $("#pubilc_set_p_small").val($(this).val());
                });

                $("#troom").change(function() {
                    $("#inside_crid_troom").val($(this).val());
                });
                $("#inside_room").change(function() {
                    $("#inside_crid_inside_room").val($(this).val());
                });
                $("#livingroom").change(function() {
                    $("#inside_crid_livingroom").val($(this).val());
                });
                $("#restroom").change(function() {
                    $("#inside_crid_restroom").val($(this).val());
                });
                $("#bookroom").change(function() {
                    $("#inside_crid_bookroom").val($(this).val());
                });
                $("#manageroom").change(function() {
                    $("#inside_crid_manageroom").val($(this).val());
                });
                $("#closeroom").change(function() {
                    $("#inside_crid_closeroom").val($(this).val());
                });
                $("#saveroom").change(function() {
                    $("#inside_crid_saveroom").val($(this).val());
                });
                $("#otherroom").change(function() {
                    $("#inside_crid_otherroom").val($(this).val());
                });

            })
        </script>

        <input type="hidden" value="<?= $object->market_research_id; ?>" id="inside_crid_troom" name="inside_crid_troom" >
        <input type="hidden" value="<?= $object->inside_crid_inside_room; ?>" id="inside_crid_inside_room" name="inside_crid_inside_room" >
        <input type="hidden" value="<?= $object->inside_crid_livingroom; ?>" id="inside_crid_livingroom" name="inside_crid_livingroom" >
        <input type="hidden" value="<?= $object->inside_crid_restroom; ?>" id="inside_crid_restroom" name="inside_crid_restroom" >
        <input type="hidden" value="<?= $object->inside_crid_bookroom; ?>" id="inside_crid_bookroom" name="inside_crid_bookroom" >

        <input type="hidden" value="<?= $object->inside_crid_manageroom; ?>" id="inside_crid_manageroom" name="inside_crid_manageroom" >
        <input type="hidden" value="<?= $object->inside_crid_closeroom; ?>" id="inside_crid_closeroom" name="inside_crid_closeroom" >
        <input type="hidden" value="<?= $object->inside_crid_saveroom; ?>" id="inside_crid_saveroom" name="inside_crid_saveroom" >
        <input type="hidden" value="<?= $object->inside_crid_otherroom; ?>" id="inside_crid_otherroom" name="inside_crid_otherroom" >

        <input type="hidden" value="<?= $object->pubilc_set_p_main; ?>" id="pubilc_set_p_main" name="pubilc_set_p_main" >
        <input type="hidden" value="<?= $object->pubilc_set_p_big; ?>" id="pubilc_set_p_big" name="pubilc_set_p_big" >
        <input type="hidden" value="<?= $object->pubilc_set_p_small; ?>" id="pubilc_set_p_small" name="pubilc_set_p_small" >






        <!--t_use_area_-->
        <input type="hidden" value="<?= $object->t_use_area_courtyard_area; ?>" id="t_use_area_courtyard_area" name="t_use_area_courtyard_area" >
        <input type="hidden" value="<?= $object->t_use_area_basement; ?>" id="t_use_area_basement" name="t_use_area_basement" >
        <input type="hidden" value="<?= $object->t_use_area_terrace; ?>" id="t_use_area_terrace" name="t_use_area_terrace" >
        <input type="hidden" value="<?= $object->t_use_area_additional; ?>" id="t_use_area_additional" name="t_use_area_additional" >




        <input type="hidden" value="<?= $object->main_build_area_main_area; ?>" id="main_build_area_main_area" name="main_build_area_main_area" >
        <input type="hidden" value="<?= $object->main_build_area_isfloor; ?>" id="main_build_area_isfloor" name="main_build_area_isfloor" >
        <input type="hidden" value="<?= $object->main_build_area_staircases; ?>" id="main_build_area_staircases" name="main_build_area_staircases" >
        <input type="hidden" value="<?= $object->main_build_area_m_b_other; ?>" id="main_build_area_m_b_other" name="main_build_area_m_b_other" >




        <input type="hidden" value="<?= $object->subsidiary_sun_area ?>" id="subsidiary_sun_area"
               name="subsidiary_sun_area" >
        <input type="hidden" value="<?= $object->subsidiary_flower_sun ?>" id="subsidiary_flower_sun"
               name="subsidiary_flower_sun" >
        <input type="hidden" value="<?= $object->subsidiary_falt_sun ?>" id="subsidiary_falt_sun"
               name="subsidiary_falt_sun" >
        <input type="hidden" value="<?= $object->subsidiary_terrace_flat ?>" id="subsidiary_terrace_flat"
               name="subsidiary_terrace_flat" >
        <input type="hidden" value="<?= $object->subsidiary_no_sun ?>" id="subsidiary_no_sun"
               name="subsidiary_no_sun" >
        <input 	type="hidden"
                value="<?= $object->subsidiary_subsid_other ?>"
                id="subsidiary_subsid_other"
                name="subsidiary_subsid_other" >



        <!-- 物件資料結束 -->
        </div>


        <div id="hous_ebuilding_select" style="display: none;">

            <div id="area_div"  style="float:left;
                 padding:10px;
                 width:102px;
                 height:350px;
                 display: none;">
                <h3>行政區</h3>

                <select name="hous_ebuilding_administrative_area"
                        id="hous_ebuilding_administrative_area"
                        style="width:102px;" size="20"
                        onchange="hous_ebuilding_administrative_area_choose();">

                    <option value="">請選擇</option>
                    <?
                    foreach($administrative_area as $key=>$val){
                    ?>
                    <option value="<?= $val->id ?>"><?= $val->name ?></option>
                    <?
                    }
                    ?>
                </select>
            </div>
            <div id="street_div" style="float:left;padding:10px">
                <h3>街道</h3>
                <select onchange="hous_ebuilding_street_choose()" style="width:102px;" size="20" id="hous_ebuilding_street">
                    <option value="">請選擇</option>
                </select>
            </div>
            <div id="other_div" style="float:left;padding:10px">
                <h3>其它</h3>

                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('number_1')" value="1" class="button" name="number_1" id="number_1">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_2')" value="2" class="button" name="number_2" id="number_2">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_3')" value="3" class="button" name="number_3" id="number_3">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_4')" value="4" class="button" name="number_4" id="number_4">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_5')" value="5" class="button" name="number_5" id="number_5">
                </div>
                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('number_6')" value="6" class="button" name="number_6" id="number_6">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_7')" value="7" class="button" name="number_7" id="number_7">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_8')" value="8" class="button" name="number_8" id="number_8">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_9')" value="9" class="button" name="number_9" id="number_9">
                    <input type="button" onclick="hous_ebuilding_word_choose('number_0')" value="0" class="button" name="number_0" id="number_0">
                </div>

                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('road')" value="路" class="button" name="road" id="road">
                    <input type="button" onclick="hous_ebuilding_word_choose('word_street')" value="街" class="button" name="word_street" id="word_street">
                    <input type="button" onclick="hous_ebuilding_word_choose('paragraph')" value="段" class="button" name="paragraph" id="paragraph">
                    <input type="button" onclick="hous_ebuilding_word_choose('lane')" value="巷" class="button" name="lane" id="lane">
                </div>
                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('get')" value="弄" class="button" name="get" id="get">
                    <input type="button" onclick="hous_ebuilding_word_choose('number')" value="號" class="button" name="number" id="number">
                    <input type="button" onclick="hous_ebuilding_word_choose('floor')" value="樓" class="button" name="floor" id="floor">
                    <input type="button" onclick="hous_ebuilding_word_choose('room')" value="室" class="button" name="room" id="room">
                </div>

                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('the')" value="之" class="button" name="the" id="the">
                    <input type="button" onclick="hous_ebuilding_word_choose('village')" value="村" class="button" name="village" id="village">
                    <input type="button" onclick="hous_ebuilding_word_choose('in')" value="里" class="button" name="in" id="in">
                    <input type="button" onclick="hous_ebuilding_word_choose('neighbor')" value="鄰" class="button" name="neighbor" id="neighbor">
                </div>

                <div>
                    <input type="button" onclick="hous_ebuilding_word_choose('del')" value="Del" class="button" name="del" id="del">
                </div>


            </div>
            <div style="clear: both;"></div>
            <div id="addr_div" style="padding:10px">
                <input type="text" value="" id="hous_ebuilding_address" style="width:400px;">
            </div>

        </div>



        <div id="address_select" style="display: none;">
            <div id="city_div"  style="float:left;padding:10px">
                <h3>縣市</h3>
                <select onchange="city_choose();" size="20" id="city">
                    <option value="">請選擇</option>
                    <?
                    foreach($address_city as $key=>$val){
                    ?>
                    <option value="<?= $val->id ?>"><?= $val->name ?></option>
                    <?
                    }
                    ?>
                </select>
            </div>



<?php
$this->load->view("showbox/address");
?>








            <div id="part_select" style="display: none;">
                <div id="part_city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="part_city_choose();" style="width:102px;" size="30" id="part_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>
                <div id="part_country_div"  style="float:left;padding:10px;width:102px;">
                    <h3>區域</h3>
                    <select onchange="part_country_choose();" style="width:102px;" size="30" id="part_country">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_county as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>" ><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>
                <div id="part_div"  style="float:left;padding:10px;width:102px;">
                    <h3>公園</h3>
                    <select onchange="part_choose();" style="width:102px;" size="30" id="part">
                        <option value="">請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="p_div" style="padding:10px">
                    <input type="text" value="" id="part_value" >
                </div>

            </div>


            <div id="elementary_school_select" style="display: none;">
                <div id="elementary_school_city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="elementary_school_city_choose();" style="width:102px;" size="30" id="elementary_school_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>
                <div id="elementary_school_div"  style="float:left;padding:10px;width:150px;">
                    <h3>國小學校</h3>
                    <select onchange="elementary_school_choose();" style="width:150px;" size="30" id="elementary_school">
                        <option value="" selected>請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="s_div" style="padding:10px">
                    <input type="text" value="" id="elementary_school_value" style="width:300px;">
                </div>

            </div>

            <div id="junior_school_select" style="display: none;">
                <div id="junior_school_city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="junior_school_city_choose();" style="width:102px;" size="30" id="junior_school_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>
                <div id="junior_school_div"  style="float:left;padding:10px;width:150px;">
                    <h3>國中學校</h3>
                    <select onchange="junior_school_choose();" style="width:150px;" size="30" id="junior_school">
                        <option value="" selected>請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="s_div" style="padding:10px">
                    <input type="text" value="" id="junior_school_value" style="width:300px;">
                </div>

            </div>
            <div id="senior_middle_school_select" style="display: none;">
                <div id="senior_middle_school_city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="senior_middle_school_city_choose();" style="width:102px;" size="30" id="senior_middle_school_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>
                <div id="senior_middle_school_div"  style="float:left;padding:10px;width:150px;">
                    <h3>高中學校</h3>
                    <select onchange="senior_middle_school_choose();" style="width:150px;" size="30" id="senior_middle_school">
                        <option value="" selected>請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="s_div" style="padding:10px">
                    <input type="text" value="" id="senior_middle_school_value" style="width:300px;">
                </div>

            </div>

            <div id="emphasis_area_select" style="display: none;"  class="form_style">
                <table class="windows_choose">
                    <thead>
                        <tr>
                            <th>選擇</th>
                            <th>重點區域</th>
                            <th>說明</th>

                        </tr>
                    </thead>
                    <tbody>
                        <?
                        foreach($emphasis_area as $key=>$val){
                        ?>
                        <tr id="t_<?= $val->emphasis_area_id ?>">
                            <td><input type="radio" value="<?= $val->value ?>" name="emphasis_area_value" id="emphasis_area_value"></td>
                            <td><?= $val->value ?></td>
                            <td><?= $val->explanation ?></td>
                        </tr>
                        <?
                        }
                        ?>
                    </tbody>
                </table>
            </div>

            <div id="circle_select" style="display: none;"  class="form_style">
                <div id="circle_city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="circle_city_choose();" style="width:102px;" size="30" id="circle_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>

                <div id="circle_country_div"  style="float:left;padding:10px;width:102px;">
                    <h3>區域</h3>
                    <select onchange="circle_country_choose();" style="width:102px;" size="30" id="circle_country">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_county as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>" ><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>

                <div id="circle_div"  style="float:left;padding:10px;width:102px;">
                    <h3>商圈</h3>
                    <select onchange="circle_choose();" style="width:102px;" size="30" id="circle">
                        <option value="">請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="p_div" style="padding:10px">
                    <input type="text" value="" id="circle_value" style="width:300px;">
                </div>
            </div>


            <div id="locate_map_select" style="display: none;" >
                <div id="map_canvas" style="width:620px;height:600px"></div>
                <div>
                    纬度：<input type="text" id="_latitude">经度：<input type="text" id="_longitude">
                    <span style="color:red;">拖動標記圖片以定位(注：默認顯示台北市)</span>
                </div>
            </div>

            <div id="administrative_area_select" style="display: none;">
                <div id="city_div"  style="float:left;padding:10px">
                    <h3>縣市</h3>
                    <select onchange="administrative_area_city_choose();" style="width:102px;" size="30" id="administrative_city">
                        <option value="">請選擇</option>
                        <?
                        foreach($address_city as $key=>$val){
                        ?>
                        <option value="<?= $val->id ?>"><?= $val->name ?></option>
                        <?
                        }
                        ?>
                    </select>
                </div>

                <div id="area_div"  style="float:left;padding:10px;width:102px;">
                    <h3>區域</h3>
                    <select onchange="administrative_area_choose();" style="width:102px;" size="30" id="administrative_country">
                        <option value="">請選擇</option>
                    </select>
                </div>
                <div style="clear: both;"></div>
                <div id="addr_div" style="padding:10px">
                    <input type="text" value="" id="administrative_area_value" >
                </div>

            </div>

            <div id="use_area_select" style="display: none;"  class="form_style">
                <table>
                    <tr>
                        <td>庭院面積</td>
                        <td><input type="text" value="<?= $object->t_use_area_courtyard_area ?>" id="courtyard_area" name="courtyard_area" style="width:150px;">坪</td>
                        <td>地下室</td>
                        <td><input type="text" value="<?= $object->t_use_area_basement ?>" id="basement" name="basement" style="width:150px;">坪</td>
                    </tr>
                    <tr>
                        <td>露台</td>
                        <td><input type="text" value="<?= $object->t_use_area_terrace ?>" id="terrace" name="terrace" style="width:150px;">坪</td>
                        <td>增建</td>
                        <td><input type="text" value="<?= $object->t_use_area_additional ?>" id="additional" name="additional" style="width:150px;">坪</td>
                    </tr>
                </table>
            </div>


            <!--***************************************************************************************-->


            <style>
                div.form_style_victor {
                    width: 350px;
                    margin: 20px 0;
                }
                div.form_style_victor table {
                    margin: 1em 0;
                    border-collapse: collapse;
                    width: 100%;
                }
                div.form_style_victor table td, div.form_style_victor table th {
                    padding: .6em 10px;
                    text-align: left;
                }
                .form_style_victor {
                    padding: .3em;
                }

            </style>

            <div id="subsidiary" style="display: none;"  class="form_style_victor">
                <table cellpadding="5" >
                    <tr style="margin:5px;">
                        <td>陽台</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_sun_area ?>"
                                   id="sun_area"
                                   name="subsidiary[sun_area]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>花台</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_flower_sun ?>"
                                   id="flower_sun"
                                   name="subsidiary[flower_sun]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>平台</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_falt_sun ?>"
                                   id="falt_sun"
                                   name="subsidiary[falt_sun]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>露台</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_terrace_flat ?>"
                                   id="terrace_flat"
                                   name="subsidiary[terrace_flat]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>遮陽</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_no_sun ?>"
                                   id="no_sun"
                                   name="subsidiary[no_sun]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>其他</td>
                        <td>
                            <input type="text" value="<?= $object->subsidiary_subsid_other ?>"
                                   id="subsid_other"
                                   name="subsidiary[subsid_other]" style="width:150px;">
                            坪                    </td>
                    </tr>
                </table>
            </div>
            <div id="pubilc_set" style="display: none;"  class="form_style_victor">
                <table cellpadding="5" >
                    <tr style="margin:5px;">
                        <td>公設</td>
                        <td>
                            <input type="text" value="<?= $object->pubilc_set_p_main ?>"
                                   id="p_main"
                                   name="pubilc_set[p_main]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>大公設</td>
                        <td>
                            <input type="text" value="<?= $object->pubilc_set_p_big ?>"
                                   id="p_big"
                                   name="pubilc_set[p_big]" style="width:150px;">
                            坪                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>小公設</td>
                        <td>
                            <input type="text" value="<?= $object->pubilc_set_p_small ?>"
                                   id="p_small"
                                   name="pubilc_set[p_small]" style="width:150px;">
                            坪                    </td>
                    </tr>
                </table>
            </div>
            <div id="main_build_area" style="display: none;"  class="form_style_victor">
                <table cellpadding="5" >

                    <tr style="margin:5px;">
                        <td>層次</td>
                        <td>
                            <input type="text" value="<?= $object->main_build_area_main_area ?>"
                                   id="main_area"
                                   name="main_build_area[main_area]" style="width:150px;">
                            坪                    </td>
                    </tr>

                    <tr style="margin:5px;">
                        <td>騎樓</td>
                        <td>
                            <input type="text" value="<?= $object->main_build_area_isfloor ?>"
                                   id="isfloor"
                                   name="main_build_area[isfloor]" style="width:150px;">
                            坪                    </td>
                    </tr>

                    <tr style="margin:5px;">
                        <td>電梯樓梯間</td>
                        <td>
                            <input type="text" value="<?= $object->main_build_area_staircases ?>"
                                   id="staircases"
                                   name="main_build_area[staircases]" style="width:150px;">
                            坪                    </td>
                    </tr>

                    <tr style="margin:5px;">
                        <td>其他</td>
                        <td>
                            <input type="text" value="<?= $object->main_build_area_m_b_other ?>"
                                   id="m_b_other"
                                   name="main_build_area[m_b_other]" style="width:150px;">
                            坪                    </td>
                    </tr>

                </table>
            </div>

            <div id="inside_crid" style="display: none;"  class="form_style_victor">
                <table cellpadding="5" >

                    <tr style="margin:5px;">
                        <td>房</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_troom ?>"
                                   id="troom"
                                   name="inside_crid[troom]" style="width:20px;">
                            間 ，
                            （含
                            <input type="text" value="<?= $object->inside_crid_inside_room ?>"
                                   id="inside_room"
                                   name="inside_crid[inside_room]" style="width:20px;">
                            套房）

                        </td>
                    </tr>


                    <tr style="margin:5px;">
                        <td>廳</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_livingroom ?>"
                                   id="livingroom"
                                   name="inside_crid[livingroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>衛</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_restroom ?>"
                                   id="restroom"
                                   name="inside_crid[restroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>書房</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_bookroom ?>"
                                   id="bookroom"
                                   name="inside_crid[bookroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>管家房</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_manageroom ?>"
                                   id="manageroom"
                                   name="inside_crid[manageroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>更衣室</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_closeroom ?>"
                                   id="closeroom"
                                   name="inside_crid[closeroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>儲藏室</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_saveroom ?>"
                                   id="saveroom"
                                   name="inside_crid[saveroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                    <tr style="margin:5px;">
                        <td>其他</td>
                        <td>
                            <input type="text" value="<?= $object->inside_crid_otherroom ?>"
                                   id="otherroom"
                                   name="inside_crid[otherroom]" style="width:150px;">
                            間                    </td>
                    </tr>
                </table>
            </div>



    </form>
</div>
<?=
isset($footer) ? $footer : ''
?>
